package com.example.smart.ui.activity.home

import com.example.lib.extend.initTab
import com.example.lib.utils.statusbar.StatusBarUtils
import com.example.smart.R
import com.example.smart.adapter.viewpager.ViewPagerAdapter
import com.example.smart.base.ui.activity.BaseActivity
import com.example.smart.base.ui.fragment.BaseFragment
import com.example.smart.databinding.ActivityRankBinding
import com.example.smart.ui.fragment.RankFragment

class RankActivity : BaseActivity<ActivityRankBinding>() {
    private var mFragments: MutableList<BaseFragment<*>> = mutableListOf()

    override fun layoutID() = R.layout.activity_rank

    override fun initView() {
        StatusBarUtils.setStateAndNavigationBar(this@RankActivity,
            statusBarColor = com.example.lib.R.color.black_ececf8)

        binding.Tab.initTab(binding.Pager, mutableListOf("总榜", "好友榜"), isAdjustMode = false)

        mFragments = mutableListOf(RankFragment.getInstance(1), RankFragment.getInstance(2))
        binding.Pager.isUserInputEnabled = false
        binding.Pager.adapter = ViewPagerAdapter(this@RankActivity, mFragments)
        binding.Pager.offscreenPageLimit = mFragments.size
    }

    override fun isNeedAllTab() = true
}